package com.ylxin.smartplatform.mapper;

import com.ylxin.smartplatform.pojo.SysDevice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author 29048
 * @version V1.0
 * @Project bk2205
 * @Package com.ylxin.smartplatform.mapper
 * @Description: Create by 杨立新 @Date 2022/9/15 22:26
 */
public interface DeviceMapper {

    /**
     * 根据设备id查找
     * @param id
     * @return
     */
    @Select("SELECT * FROM sys_device WHERE device_id = #{id}")
    SysDevice findByDeviceId(String id);

    /**
     * 绑定设备
     * @param sysDevice
     */
    void bindDevice(SysDevice sysDevice);

    /**
     * 更新设备状态的功能
     * @param deviceId
     * @param status
     * @return
     */
    int updateDeviceStatus(@Param("deviceId")String deviceId, @Param("status") int status);
}
